package com.class5.springboot.entity.code;

import com.class5.springboot.frame.code.CodeItemUtils;
import com.class5.springboot.frame.code.CodeItem;
import java.util.ArrayList;
import java.util.List;

/**
 * 01:正常,02:禁用
 **/
public final class SysUserStatus {

    /**正常*/
    public static final String NORMAL = "01";

    /**禁用*/
    public static final String DISABLED = "02";

    public static String getVal(String text) {
        String val = null;
        if ("正常".equals(text)) {
            val = NORMAL;
        }
        if ("禁用".equals(text)) {
            val = DISABLED;
        }
        return val;
    }

    public static String getText(String val) {
        String text = null;
        if (NORMAL.equals(val)) {
            text = "正常";
        }
        if (DISABLED.equals(val)) {
            text = "禁用";
        }
        return text;
    }

    public static List getList() {
        List<CodeItem> list = new ArrayList<>();
        list.add(CodeItemUtils.getCodeItem(NORMAL, getText(NORMAL)));
        list.add(CodeItemUtils.getCodeItem(DISABLED, getText(DISABLED)));
        return list;
    }
}
